package shortestpath.astar.node;

import shortestpath.Node;

public class NodeFactory {

	private NodeFactory() {
		throw new AssertionError();
	}

	public static <T extends Node> OpenNode<T> convertToOpenNode(final T node,
			final ListedNode<T> predecessor, final int weight) {
		return new OpenNode.OpenNodeImpl<T>(node, predecessor, weight);
	}

	public static <T extends Node> ListedNode<T> convertToClosedNode(
			final T node, final ListedNode<T> predecessor) {
		return new AbstractListedNode<T>(node, predecessor) {
		};
	}

}
